#ifndef LOGINDIALOG_H
#define LOGINDIALOG_H

#include <QDialog>
#include <QJsonObject>
#include "protocol.h"
#include "models.h"

namespace Ui {
class LoginDialog;
}

class LoginDialog : public QDialog {
    Q_OBJECT
    
public:
    explicit LoginDialog(QWidget *parent = nullptr);
    ~LoginDialog();
    
private slots:
    void on_loginButton_clicked();
    void on_registerButton_clicked();
    void onMessageReceived(MessageType type, const QJsonObject& data);
    
private:
    bool connectToServer();
    
    Ui::LoginDialog *ui;
    User m_currentUser;
};

#endif // LOGINDIALOG_H

